<%@ page pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <c:url var="base" value="/"/>
    <base href="${base}">
    <meta charset="UTF-8">
    <title>新闻公告后台</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body{
            background-image: url("images/background2.jpg");
            background-repeat: repeat;
        }
        #article {
            margin: 0px auto;
            margin-top: 40px;
            height: 100%;
            width: 80%;
        }
        ul {
            list-style: none;
        }
        table {
            width: 100%;
            table-layout: fixed;
            border-collapse: collapse;
        }
        table thead {
            background-color: #5ad760;
            color: b;
        }
        table th, table td,input{
            padding: 8px;
            text-align: center;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            border-bottom: 2px solid #8f7eff;
            color: black;
        }
        tbody tr:nth-child(even){
            background-color: #b3a0ff;
        }
        tbody tr:nth-child(odd){
            background-color: #54c3ff;
        }
        .btn {
            display: inline-block;
            background-color: #ff7070;
            color: white;
            padding: 10px 15px;
            text-decoration: none;
            border-radius: 5px;
            font-size: 15px;
            border: 2px rgba(91, 91, 91, 0.8) solid;
        }
        .btn:hover{
            background-color: #617581;
        }
        .return{
            background-color: #00d9ff;
            color:black;
        }
        .normal{
            background-color: #5984ff;
        }
        .righttop{
            position: absolute;
            right: 5px;
            top: 5px;
        }
        .lefttop{
            position: absolute;
            left: 5px;
            top: 5px;
        }
        .right{
            margin-top: 10px;
            float: right;
        }
        .blank{
            height: 30px;
        }
        .tablehead td{
            font-size: 20px;
            font-weight: 600;
        }
    </style>
</head>
<body>
<div class="lefttop"><a class="btn return" href="index">返回首页</a></div>
<div>
    <%@include file="/WEB-INF/jsp/logbutton.jsp" %>
</div>
<div id="article">
    <div class="blank"></div>
    <h2>新闻公告</h2><br>
    <table>
        <thead>
        <tr class="tablehead">
            <td>#</td>
            <td>标题</td>
            <td>时间</td>
            <td colspan=3>操作</td>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${items}" var="u">
            <tr>
                <td>${u.id}</td>
                <td>${u.name}</td>
                <td>${u.date}</td>
                <td style="text-align: right"><a class="btn normal" href="news?uid=${u.id}">详细</a></td>
                <td><a class="btn normal" href="newsupdate?uid=${u.id}&op=update">修改</a></td>
                <td style="text-align: left">
                    <div>
                        <form action="delete" method="post" id="2">
                            <input type="text" style="display: none" name="uid" value="<c:out value='${u.id}'/>">
                            <input class="btn" type="submit" value="删除">
                        </form>
                    </div>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <a class="btn right normal" href="newsupdate?uid=${maxid}&op=new">新建</a>
</div>
</body>
</html>